package com.example.xadmin.pojo;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.beans.BeanUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

/**
 * <p>
 * 
 * </p>
 *
 * @author Administrator
 * @since 2020-04-05
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_permission")
public class SysPermission implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = ID, type = IdType.AUTO)
    private Integer id;

    @TableField(PARENTID)
    private Integer parentId;

    @TableField(NAME)
    private String name;

    @TableField(CSS)
    private String css;

    @TableField(HREF)
    private String href;

    @TableField(TYPE)
    private String type;

    @TableField(PERMISSION)
    private String permission;

    @TableField(SORT)
    private Integer sort;


    public static final String ID = "`id`";

    public static final String PARENTID = "`parentId`";

    public static final String NAME = "`name`";

    public static final String CSS = "`css`";

    public static final String HREF = "`href`";

    public static final String TYPE = "`type`";

    public static final String PERMISSION = "`permission`";

    public static final String SORT = "`sort`";


    public static final String ID_COMMENT = "";

    public static final String PARENTID_COMMENT = "";

    public static final String NAME_COMMENT = "";

    public static final String CSS_COMMENT = "";

    public static final String HREF_COMMENT = "";

    public static final String TYPE_COMMENT = "";

    public static final String PERMISSION_COMMENT = "";

    public static final String SORT_COMMENT = "";



    public static SysPermission of(Object obj) {
        SysPermission e = new SysPermission();
        BeanUtils.copyProperties(obj, e);
        return e;
    }

    public static QueryWrapper<SysPermission> queryWrapper(Object obj) {
        return new QueryWrapper<>(of(obj));
    }

}
